1. [Exact match] //movie[title=District B13]/year/text()
The year in which the movie District B13 has been released
document("result-05.xml")//movie[title//text()="District B13"]/year//text()
81 results
for $a in document("MovieDB_Px.xml")//movie[title="District B13"] for $b in $a/year/text() let  $feuilles:=($b) let $atts:=(for $i in $feuilles return $i/ancestor-or-self::*/attribute(event)) return <match>{ distinct-values(for $att in $atts return string($att)) }</match>


2. [Tree navigation] //movie[actors/actor/name=Brooke Smith]/title/text()
The titles of all movies in which Brooke Smith is an actor
document("result-05.xml")//movie[actors//actor//name="Brooke Smith"]//title//text()
41 results
for $a in document("MovieDB_Px.xml")//movie[actors/actor/name="Brooke Smith"] for $b in $a/title/text() let  $feuilles:=($b) let $atts:=(for $i in $feuilles return $i/ancestor-or-self::*/attribute(event)) return <match>{ distinct-values(for $att in $atts return string($att)) }</match>


3. [Join] //movie[year=//movie[actors/actor/name=David Belle]/year]/title/text()
The titles of all movies of the same year as a movie with actor David Belle
for $a in document("MovieDB_Px.xml")//movie[year=//movie[actors/actor/name="David Belle"]/year] for $b in $a/title/text() let  $feuilles:=($b) let $atts:=(for $i in $feuilles return $i/ancestor-or-self::*/attribute(event)) return <match>{ distinct-values(for $att in $atts return string($att)) }</match>
